import { datashopAxios } from '@/utils/request'

// 列表
export const reqDataDomainList = (params: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/industry-domains',
    method: 'get',
    params
  })
}
// 新增
export const reqDataDomainAdd = (data: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/industry-domains',
    method: 'post',
    data
  })
}
// 编辑
export const reqDataDomainEdit = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}`,
    method: 'put',
    data
  })
}
// 下架
export const reqRevokeDataDomain = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}:revoke`,
    method: 'post',
    data
  })
}
// 上架
export const reqPublishDataDomain = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}:publish`,
    method: 'post',
    data
  })
}
// 上移数据
export const moveUpDataDomain = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}:move-up`,
    method: 'post',
    data
  })
}
// 下移数据
export const moveDownDataDomain = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}:move-down`,
    method: 'post',
    data
  })
}
// 删除
export const reqDeleteDataDomain = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/industry-domains/${data.id}`,
    method: 'delete',
    data
  })
}
